
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.EvStandardDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class EvStandardDaoJdbc extends BaseDaoJdbc implements EvStandardDao {
	String tableName="T_EV_STANDARD";
	String beanName="evStandard";
	
	public CommonBean createEvStandard(){
		CommonBean evStandards=this.createBean(tableName,beanName);
                return evStandards;		
	}
	
/*
	public CommonBean findEvStandards(String refid) {
		CommonBean evStandards=this.createEvStandard();
		String sql="select * from T_EV_STANDARD where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		evStandards.addData(data);
                return evStandards;
       }
*/
	public CommonBean findEvStandardById(String id) {
		CommonBean evStandards=this.createEvStandard();
		String sql="select * from T_EV_STANDARD where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		evStandards.addData(data);
    return evStandards;
  }
  
	public CommonBean findAllEvStandards() {
		CommonBean evStandards=this.createEvStandard();
		String sql="select * from T_EV_STANDARD order by level_no";
		List data=this.getCommonDao().select(sql,new String[]{});
		evStandards.addData(data);
    return evStandards;
  }
	public void insertEvStandard(CommonBean evStandardBean){
		List data=evStandardBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
	public void updateEvStandard(CommonBean evStandardBean){
		List data=evStandardBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchUpdate(row,data);
	}
}

